<%@page import="com.itextpdf.text.log.SysoLogger"%>
<%@page import="com.reachol.objects.User"%>
<%@page import="com.reachol.objects.Users"%>
<%@page import="javax.servlet.http.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.jimet.security.MD5"%>

<%
	String mail = request.getParameter("mail");
	String password = request.getParameter("pass");
	String passwordMD5 = MD5.hash(password);
	String isTrue = "category"; //girdi mi diye kontrol edicez. şifre doğru mu yani.
	
	Users users = new Users();
	users.load("ASC", "id");
	while (users.next()) {
		User tmpObj = (User) users.getNext();
		long userId=tmpObj.getId();
		if (tmpObj.getMail().equals(mail)
				&& tmpObj.getPassword().equals(passwordMD5) && tmpObj.getStatus()==1) {
			isTrue = "category";
			break;
		} 
		else if (tmpObj.getMail().equals(mail)
				&& tmpObj.getPassword().equals(passwordMD5) && tmpObj.getStatus()==2)
		{
			isTrue = "content";
			break;
		}
		else 
		{
			isTrue = "0";
		}
	}
%>
<%=isTrue%>

